﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Reflection;
using System.Configuration;
using System.IO;
using System.Text.RegularExpressions;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Collections;
using System.Reflection;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;

namespace TestsForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            //PerformanceCounterCategory performanceCounterCategory = new PerformanceCounterCategory("Network Interface");
            //PerformanceCounter performanceCounterSent = new PerformanceCounter("Process", "IO Read Bytes/sec", process.ProcessName);


            String yy = "";

            var x = PerformanceCounterCategory.GetCategories();
            for (int i = 0; i < x.Length; i+=8)
            {
                try
                {
                    yy += x[i].CategoryName + "," + x[i + 1].CategoryName + "," + x[i + 2].CategoryName + "," + x[i + 3].CategoryName + "," +
                        x[i + 4].CategoryName + "," + x[i + 5].CategoryName + "," + x[i + 6].CategoryName + "," + x[i + 7].CategoryName + "\n";
                }
                catch
                {
                }
            }

            MessageBox.Show(yy);


         

        }
    }

    public class RunningOptionsProperties
    {
        public RunningOptionsProperties()
        {
        }

        public RunningOptionsProperties(RunningOptionsProperties optionsObject)
        {
            Init(optionsObject);
        }

        public void Init(RunningOptionsProperties optionsObject)
        {
            ProcessesRunningTime = optionsObject.ProcessesRunningTime;
            CpuConsumptionComparison = optionsObject.CpuConsumptionComparison;
            PrivateMemoryUse = optionsObject.PrivateMemoryUse;
            PagingSpace = optionsObject.PagingSpace;
            NumberOfThread = optionsObject.NumberOfThread;
            VirtualMemorySize = optionsObject.VirtualMemorySize;
            ModulesLoaded = optionsObject.ModulesLoaded;
            NetworkReceived = optionsObject.NetworkReceived;
            NetworkSent = optionsObject.NetworkSent;
        }

        [CategoryAttribute("Running Configurations"), DisplayName("Processes Running Time"),
            DescriptionAttribute("The program's running time in seconds")]
        public int ProcessesRunningTime { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Cpu Consumption Comparison"), DefaultValue(true)]
        public bool CpuConsumptionComparison { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Private Memory Use"), DefaultValue(true)]
        public bool PrivateMemoryUse { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Paging Space"), DefaultValue(true)]
        public bool PagingSpace { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Number Of Thread"), DefaultValue(true)]
        public bool NumberOfThread { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Virtual Memory Size"), DefaultValue(true)]
        public bool VirtualMemorySize { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Modules Loaded"), DefaultValue(true)]
        public bool ModulesLoaded { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Network Received"), DefaultValue(true)]
        public bool NetworkReceived { get; set; }

        [CategoryAttribute("Graphs Displays Configurations"), DisplayName("Network Sent"), DefaultValue(true)]
        public bool NetworkSent { get; set; }
    }
}
